package com.hrm.dao;

import com.hrm.entity.PosEntity;

import java.util.List;

/**
 * Create by zekdot on 20-3-8.
 */
public class PosDao extends BaseDao<PosEntity> {
    /**
     * 根据部门名称获取职位列表
     * @param depName 部门名称
     * @return
     */
    public List<PosEntity> getListByDep(String depName) throws Exception {

        String sql = "SELECT * FROM pos WHERE department_name=?";
        Object[] params = {depName};
        return queryList(sql,params);
    }

    public static void main(String args[]){
        PosDao posDao = new PosDao();
        try {
            System.out.println(posDao.getListByDep("指挥部"));
            System.out.println(posDao.getListByDep("财政部"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
